import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

export function listInfo(query){
  return request({
    url: '/construction/info/list',
    method: 'get',
    params: query
  })
}

export function getInfo(infoId){
  return request({
    url: '/construction/info/' + praseStrEmpty(infoId),
    method: 'get'
  })
}

export function addInfo(data){
  return request({
    url: '/construction/info',
    method: 'post',
    data: data
  })
}

export function updateInfo(data){
  return request({
    url: '/construction/info',
    method: 'put',
    data: data
  })
}

export function deleteInfo(constructionId){
  return request({
    url: '/construction/info/'+constructionId,
    method: 'delete',
  })
}

export function changeInfoStatus(constructionId,publishStatus){
  const data = {
    constructionId,
    publishStatus
  }
  return request({
    url: '/construction/info/changeStatus',
    method: 'put',
    data: data
  })
}

export function changeInfoAuditStatus(constructionId,auditStatus){
  const data = {
    constructionId,
    auditStatus
  }
  return request({
    url: '/construction/info/changeAuditStatus',
    method: 'put',
    data: data
  })
}

// 导出
export function exportInfo(query) {
  return request({
    url: '/construction/info/export',
    method: 'get',
    params: query
  })
}
